<template>
  <div id="app">
    <CountDown @end="end" @start="start" @stop="stop" @reset="reset" :doneTime="10"></CountDown>
  </div>
</template>

<script>
import CountDown from './components/CountDown.vue';
export default {
  name: 'App',
  components: {
    CountDown
  },
  mounted() {
    // 绑定事件
    this.bus.$on("show", (e) => {
      console.log("触发了show", e)
    })
    // 绑定事件
    this.bus.$on("add", (e) => {
      console.log("触发了add")
    })
  },
  methods: {
    // 倒计时结束的回调
    end() {
      console.log("倒计时结束")
    },
    start() {
      console.log("倒计时开始");
    },
    stop(e) {
      console.log("倒计时停止,还剩" + e + "毫秒");
    },
    reset() {
      console.log("倒计时重置");
    },
  }
}
</script>

<style></style>
